{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import cv2\n",
    "\n",
    "left = cv2.VideoCapture(0)\n",
    "right = cv2.VideoCapture(1)\n",
    "\n",
    "while(True):\n",
    "    if not (left.grab() and right.grab()):\n",
    "        print(\"No more frames\")\n",
    "        break\n",
    "\n",
    "    _, leftFrame = left.retrieve()\n",
    "    _, rightFrame = right.retrieve()\n",
    "\n",
    "    cv2.imshow('left', leftFrame)\n",
    "    cv2.imshow('right', rightFrame)\n",
    "    if cv2.waitKey(1) & 0xFF == ord('q'):\n",
    "        break\n",
    "\n",
    "left.release()\n",
    "right.release()\n",
    "cv2.destroyAllWindows()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
